package cn.com.surker.material.dao;

import cn.com.surker.material.entity.MaterialOutboundItem;
import cn.com.surker.material.entity.MaterialOutboundItemReport;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 材料领用记录 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2023-07-19
 */
public interface MaterialOutboundItemDao extends BaseMapper<MaterialOutboundItem> {

	@Override
	List<MaterialOutboundItem> selectList(@Param(Constants.WRAPPER) Wrapper<MaterialOutboundItem> queryWrapper);

	List<MaterialOutboundItemReport> selectListCen(Long orgId, String startDate, String endDate);

	/**
	 * 出库总数
	 * @param orgId
	 * @param startTime
	 * @param endTime
	 * @param deptId
	 * @param searchVal
	 * @return
	 */
	Integer selectOutboundFinanceTotal(Long orgId, String startTime, String endTime, Long deptId,
                                       String searchVal);

	/**
	 * 出库金额统计
	 * @param orgId
	 * @param startTime
	 * @param endTime
	 * @param deptId
	 * @param searchVal
	 * @return
	 */
	Map<String, Object> selectOutboundFinanceSum(Long orgId, String startTime, String endTime, Long deptId,
                                                 String searchVal);

	/**
	 * 出库明细
	 * @param orgId
	 * @param startTime
	 * @param endTime
	 * @param deptId
	 * @param searchVal
	 * @param offset
	 * @param limit
	 * @return
	 */
	List<Map<String, Object>> selectOutboundFinance(Long orgId, String startTime, String endTime, Long deptId,
                                                    String searchVal, Integer offset, Integer limit);
}
